var g_canvas, g_context, g_square;

function onloadHandler()
{
    g_canvas = document.getElementById( 'canvas' );
    g_context = g_canvas.getContext( '2d' );
    g_square = new Rectangle();
   
    g_square.draw(g_context);
}    

window.onload = onloadHandler;